package Java9_8;

import java.util.ArrayList;
import java.util.LinkedList;

public class Work4 {
    public static void main(String[] args) {
        ArrayList a = new ArrayList();
        LinkedList b = new LinkedList();
        long start = System.nanoTime();
        for (int i = 0; i < 10000; i++) {
            a.add("111");
        }
        long end = System.nanoTime();
        System.out.println(end - start);
        long start1 = System.nanoTime();
        for (int i = 0; i < 10000; i++) {
            b.add("111");
        }
        long end1 = System.nanoTime();
        System.out.println(end1 - start1);
        if (end>end1){
            System.out.println("LinkedList快");
        }else {
            System.out.println("ArrayList快");
        }
    }
}
